<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<title><{$title}> - <{C('site_name')}><{C('title_end_content')}></title>
	
	<link rel="stylesheet" href="<{URL}>static/lib/bootstrap/bootstrap.min.css">
	<script src="<{URL}>static/js/jquery.min.js"></script>
	<script src="<{URL}>static/lib/bootstrap/popper.js/1.15.0/umd/popper.min.js"></script>
	<script src="<{URL}>static/lib/bootstrap/bootstrap.min.js"></script>
	<link rel="stylesheet" href="<{URL}>static/lib/font-awesome/css/font-awesome.css">
	
	<link rel="stylesheet" href="<{URL}>static/css/app.css">
	<script src="<{URL}>static/js/app.js"></script>
	<script src="<{URL}>static/js/clickableTextLink.js"></script>
	<script src="<{URL}>static/js/marked.min.js"></script>
	<script src="<{URL}>static/lib/highlight/highlight.min.js"></script>
	<link rel="stylesheet" href="<{URL}>static/lib/highlight/styles/monokai-sublime.min.css">
	
	<script>
	hljs.initHighlightingOnLoad();
	marked.setOptions({
		headerPrefix: 'md-title-',
		highlight: function(code) {
			return hljs.highlightAuto(code).value;
		},
	    breaks:true
	});
	</script>
</head>
<body>
	<nav class="navbar navbar-expand-sm bg-secondary navbar-dark fixed-top pl-3 pr-5">
		<a class="navbar-brand logo" href="#"><img src="<{URL}><{C('site_logo')}>" height="45"></a>
		
		<ul class="navbar-nav">
			<li class="nav-item">
				<a class="nav-link" href="<{url('index','index')}>">首页</a>
			</li>
			<li class="nav-item">
				<a class="nav-link" href="<{url('user','update',1)}>">关注</a>
			</li>
			
			<div class="form-inline ml-3 search">
				<input class="form-control" id="search-keyword" type="text" placeholder="请输入关键字">
				<button class="btn" type="button" id="search-submit">
					<i class="fa fa-search"></i>
				</button>
			</div>
		</ul>
		<ul class="navbar-nav ml-auto">
			<li class="nav-item">
				<{if $_U}>
					<div class="dropdown">
						<a class="nav-link dropdown-toggle" href="javascript:;" data-toggle="dropdown">
							<img src="<{$_U.avatar}>" height="40" class="rounded-circle">
							<{$_U.username}>
							<span class="red-dot msg-notice" style="display:none"></span>
						</a>
						<div class="dropdown-menu">
							<a class="dropdown-item disabled text-center"><b>菜单</b></a>
							<div class="dropdown-divider"></div>
							<a class="dropdown-item" href="<{url('user','index',UID)}>"><i class="fa fa-home"></i> 我的主页</a>
							<a class="dropdown-item" href="<{url('user','setting',0)}>"><i class="fa fa-gear"></i> 基本设置</a>
							<a class="dropdown-item" href="<{url('user','message',0,1)}>"><i class="fa fa-bell-o"></i> 我的消息 <span class="red-dot msg-notice" style="display:none"></span></a>
							<{if $_U.gid == 3}>
							<a class="dropdown-item" href="<{URL}>index.php/admin.html"><i class="fa fa-dashboard"></i> 进入后台</a>
							<{/if}>
							<div class="dropdown-divider"></div>
							<a class="dropdown-item" href="<{url('user','exit')}>"><i class="fa fa-sign-out"></i> 退出登录</a>
						</div>
					</div>
				<{else}>
					<a href="<{url('user','login')}>"><button class="btn btn-primary">登录</button></a>
					<a href="<{url('user','register')}>"><button class="btn btn-success">注册</button></a>
				<{/if}>
			</li>
		</ul>
	</nav>
	
	<script>
	$('#search-submit').click(function() {
		var keyword = $('#search-keyword').val();
		if(keyword == null || keyword == '') {
			$('#search-keyword').focus();
			HuajiBBS.tips('请输入搜索关键字','danger');
			return;
		}
		location.href = "<{url('thread','search','"+keyword+"',1)}>";
	});
	</script>
	
	<div class="layout">
		<div class="layout-tips"></div>